import http from "@/api";
import { ResPage } from "@/api/interface/index";
import { ContentTypeEnum } from "@/enums/httpEnum";
export const getAppletConfigList = (params: { appId: string }) => {
	return http.get<ResPage<any[]>>(`/service/app/config/find`, params);
};
export const delAppletConfig = (params: any) => {
	return http.post(`/service/app/config/remove`, params);
};
export const readAppletConfig = (params: any) => {
	return http.get(`/service/app/config/read`, params);
};
export const saveAppletConfig = (params: any) => {
	return http.post(`/service/app/config/save`, params);
};
export const addAppletConfig = (params: any) => {
	let formData = new FormData();
	for (let key in params) {
		formData.append(key, params[key]);
	}
	console.log(formData, params);
	return http.post(`/service/app/config/add`, formData, { Headers: { "Content-Type": ContentTypeEnum.FORM_DATA } });
};
export const modAppletConfig = (params: any) => {
	let formData = new FormData();
	for (let key in params) {
		formData.append(key, params[key]);
	}
	return http.post(`/service/app/config/modify`, formData, { Headers: { "Content-Type": ContentTypeEnum.FORM_DATA } });
};
export const upgradeConfig = (params: any) => {
	return http.post(`/service/app/config/upgrade`, params);
};
